<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>

<body>
	<input type="file" name="ff" multiple="true"><br>
	<input type="file" name="ff" multiple="true"><br>
	<input type="file" name="ff" multiple="true"><br>
	<input type="file" name="ff" multiple="true"><br>
	<input type="file" name="ff" multiple="true"><br>
	<input type="button" value="上传" id="btn1">
	<script type="text/javascript">
		let qfile=document.getElementsByName('ff');	
		let btn=document.getElementById('btn1');	
		btn.onclick=function(){
			let formmate=new FormData();
			// formmate.set('f1',file.files[0]);
			qfile.forEach(ofile=>{
				Array.from(ofile.files).forEach(item=>{
				formmate.set('f1',item);
			})
		})
			
			let xhr=new XMLHttpRequest();
			xhr.open('post','./upload/',true);

			xhr.send(formmate);
			xhr.onreadystatechange=function(){
				if(xhr.readyState==4){
					alert(xhr.status)
				}
			}
		}
	</script>
</body>
</html>